package com.bestcem.xm.award.dao.mapper;

import com.bestcem.xm.award.entity.mysql.AwardDrawAwardEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 抽奖奖励奖项mapper
 *
 * @author sh.pei <sh.pei@idiaoyan.com>
 * @version v1.0
 * @date 2021/9/14 15:29
 */
@Mapper
public interface AwardDrawAwardEntityMapper {
    /**
     *
     * @date 2021-09-23
     */
    int deleteByPrimaryKey(@Param("awardId") String awardId, @Param("index") Integer index);

    /**
     *
     * @date 2021-09-23
     */
    int insert(AwardDrawAwardEntity record);

    /**
     *
     * @date 2021-09-23
     */
    int insertSelective(AwardDrawAwardEntity record);

    /**
     *
     * @date 2021-09-23
     */
    AwardDrawAwardEntity selectByPrimaryKey(@Param("awardId") String awardId, @Param("index") Integer index);

    /**
     *
     * @date 2021-09-23
     */
    int updateByPrimaryKeySelective(AwardDrawAwardEntity record);

    /**
     *
     * @date 2021-09-23
     */
    int updateByPrimaryKey(AwardDrawAwardEntity record);

    /**
     * 根据id查询奖项数据
     *
     * @param awardId
     * @return
     */
    List<AwardDrawAwardEntity> selectByAwardId(String awardId);

    /**
     * 根据id删除奖项数据
     *
     * @param awardId
     * @return
     */
    int deleteByAwardId(String awardId);

    /**
     * 查询奖项等奖
     *
     * @param awardId
     * @return
     */
    List<Integer> queryDistinctAwardLevel(String awardId);

    /**
     * 查询奖项名称
     *
     * @param awardId
     * @return
     */
    List<String> queryDistinctAwardName(String awardId);
}